﻿
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;

namespace EcoSystem
{
    /// <summary>
    /// 报表配置Api添加或更新的DTO
    /// </summary>
    public class CreateOrUpdateHttpApiConfigDto
    {
        /// <summary>
        /// 所属分类
        /// </summary> 
        public Guid CategoryId { get; set; }

        /// <summary>
        /// 接口名称
        /// </summary>
        [Required(ErrorMessage = "请输入接口名称")]
        public string Name { get; set; }

        /// <summary>
        /// 接口编码
        /// </summary>
        [Required(ErrorMessage = "请输入接口编码")]
        public string Code { get; set; }

        /// <summary>
        /// 关联权限名
        /// </summary>
        public string PermissionName { get; set; }

        /// <summary>
        /// 允许匿名访问
        /// </summary>
        public Nullable<bool> AllowAnonymous { get; set; } 

        /// <summary>
        /// 请求参数定义
        /// </summary>
        public List<RequestFieldItem> RequestOptions { get; set; }

        /// <summary>
        /// 请求方式
        /// </summary>
        public HttpMethodEnum HttpMethod { get; set; }

        /// <summary>
        /// 操作脚本内容
        /// </summary>
        public string ScriptContent { get; set; }

        /// <summary>
        /// 返回示例结构定义
        /// 用于描述接口正常调用时返回的示例结构】、以便于文档显示
        /// </summary>
        public string DemoSchema { get; set; }

        /// <summary>
        /// 出错返回信息
        /// 定义接口调用出错时返回的错误信息及错误代码
        /// </summary>
        public string ErrorResponse { get; set; }

        /// <summary>
        /// 排序号
        /// </summary>
        public int SortIndex { get; set; }

        /// <summary>
        /// 启用标识
        /// </summary>
        public bool Status { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string Remarks { get; set; }
    }
}
